<template>
<div>
<Modal v-model="modalEdit" fullscreen @on-cancel="handleModalEditCancel" 
@on-ok="handleModalEditOK" ok-text="提交">
	<template #header>
		<Icon custom="iconfont icon-Word"/>&nbsp;听证通知书&nbsp;
	</template>
	<div><Row justify="center"><Col span="16">
		<Card title="基本情况" icon="ios-bookmark">
			<template #extra>
				提交日期：<DatePicker v-model="baseform.date2" type="date" placeholder="选择日期" style="width: 200px"/>
			</template>
			<Alert show-icon>
				<template #desc>
				<b>{{baseform.party_name}}&nbsp;&nbsp;&nbsp;涉嫌&nbsp;&nbsp;&nbsp;{{baseform.cause_name}}</b>
				</template>
			</Alert>
			<Row>
				<Col span="12"><Space>
					<span>听证提出日期：</span>
					<DatePicker v-model="baseform.date1" type="date" placeholder="选择日期" style="width: 200px"></DatePicker>
				</Space></Col>
				<Col span="12"><Space>
					<span>是否公开：</span>
					<RadioGroup v-model="baseform.open">
						<Radio label="公开" border></Radio>
						<Radio label="不公开" border></Radio>
					</RadioGroup>
				</Space></Col>
			</Row><br>
			<Row>
				<Col span="12"><Space>
					<span>主持人：</span>
					<Select v-model="baseform.legal1"  filterable>
						<Option v-for="n in optionsLegal" :value="n.uid"  :key="n.uid">
							<span>{{ n.uname }}</span>
							<span style="float: right;color: #999;">{{ n.uid }}</span>
						</Option>
					</Select>
				</Space></Col>
				<Col span="12"><Space>
					<span>听证员：</span>
					<Input v-model="baseform.officer" placeholder="输入听证员"/>
					<span>记录员：</span>
					<Input v-model="baseform.recorder" placeholder="输入记录员"/>
				</Space></Col>
			</Row>
		</Card>
	</Col></Row></div>
</Modal>
</div>
</template>

<script>
import {dateUtils,appendDoc} from '@/libs/tools.js'
import config from '@/config'
export default{
	data(){
		return {
			modalEdit:true,
			optionsLegal:[],
			baseform:{}		
		}
	},
	methods:{
		handleModalEditCancel(){
			this.$router.go(-1)
		},
		handleModalEditOK(){
			let data={...this.baseform}
			data.date1=dateUtils.format2(data.date1)
			data.date2=dateUtils.format2(data.date2)
			data.docs=appendDoc(data.docs,"doc204")
			this.$axios.post('mainCase1CreateDoc204.action',data).then(res=>{
				window.open(config.baseUrl+res.data,'_blank')
			})
			this.$router.go(-1)
		}
	},
	mounted(){
		this.$axios.post("mainCase1GetDoc103Legals.action",{str1:''})
		.then(res=>{
			this.optionsLegal=res.data
		})
		this.$axios.post('mainCase1GetDoc204.action',{
			case_no:this.$route.query.case_no,
			party_type:this.$route.query.party_type
		}).then(res=>{
			this.baseform={...this.baseform,...res.data}
			if(this.baseform.date2==null){
				this.baseform.date2=new Date()
			}
		})
	}
}
</script>

<style>
</style>